home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
snip9611.zip
/
MEMAVAIL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-24
|
595b
|
37 lines
/* +++Date last modified: 08-Sep-1996 */
/*
** MEMAVAIL.C - Report available DOS memory
**
** public domain by Thor Johnson
*/
#include <dos.h>
#include "snpdosys.h"
long memavail(void)
{
union REGS regs;
/* Request impossibly large number of 16-byte paragraphs from DOS */
regs.h.ah = 0x48;
regs.x.bx = 0xFFFF;
int86(0x21,®s,®s);
return((long)regs.x.bx * 16L);
}
#ifdef TEST
#include <stdio.h>
main()
{
printf("Available DOS memory = %ld bytes\n", memavail());
return 0;
}
#endif /* TEST */